import { GET, POST, PUT } from '@/utils/request'

/**
 * 获取用户列表
 * @param {Number} pageNum
 * @param {Number} pageSize
 * @param {Number} roleId 角色id
 * @param {Boolean} signedContract 是否签署合同
 * @param {String} nicknameLike 昵称模糊搜索
 * @param {String} sortBy 排序关键字
 * @param {String} orderBy 排序方式
 */
export const getUsers = (params) => GET('/admin/user', params)
/* 根据ID获取用户详细信息 */
export const getUser = (userId) => GET(`/admin/user/${ userId }`, {})
/* 获取合同签名图片 */
export const getUserContract = (userId) => GET(`/admin/user/contract/signature/${ userId } `, {}, 'arraybuffer')
/* 修改用户私有信息 */
export const putUserPrivate = (userId, data) => PUT(`/admin/user/${ userId }`, data)
/* 获取用户简历 */
export const getResume = (userId) => GET(`/resume/${ userId }`, {})

/* 获取用户身份认证信息 */
export const getAuthentication = (userId) => GET(`/admin/authentication/${ userId }`, {})
/* 获取身份认证图片 */
export const getAuthenticationFile = (userId, params) => GET(`/admin/authentication/file/${ userId }`, params)
/* 审核身份认证 */
export const checkAuthentication = (userId, data) => POST(`/admin/authentication/check/${ userId }`, data)

/* 分页获取用户反馈 */
export const getFeedbacks = (param) => GET('/admin/feedback', param)
/* 处理反馈 */
export const putFeedback = (data) => PUT(`/admin/feedback/${ data.id }`, data)

